﻿@using Probel.PersonalNotes.Models.Home
@{
    ViewBag.Title = "Statistiques";
    @model StatisticsContainer
}
<style type="text/css">
    .webgrid-table {
        width: 100%;
        display: table;
        /*border-collapse: separate;*/
        /*border: solid 1px #98BF21;*/
        background-color: white;
    }

        .webgrid-table td, th {
            border: 1px solid #222222;
            /*padding: 3px 7px 2px;*/
        }

    .webgrid-header {
        background-color: #222222;
        color: #FFFFFF;
        padding-bottom: 4px;
        padding-top: 5px;
        text-align: right;
    }

    .webgrid-footer {
    }

    .webgrid-row-style {
        padding: 3px 7px 2px;
    }

    .webgrid-alternating-row {
        background-color: #eeeeee;
        padding: 3px 7px 2px;
    }
</style>

<div class="jumbotron">
    <style>
        label {
            width: 110px;
        }

        checkbox {
            width: 110px;
        }
    </style>
    <h1>Statistiques</h1>
    @using (Html.BeginForm("Record", "Home", FormMethod.Get))
    {
        <h2 class="lead">Résumé global</h2>
        <p>
            <label>Total: </label>
            @Html.DisplayFor(m => m.Summary.Total)
        </p>
        <p>
            <label>Uniques:</label>
            @Html.DisplayFor(m => m.Summary.CountSingles)
        </p>
        <p>
            <label>Doublons:</label>
            @Html.DisplayFor(m => m.Summary.CountDoubloons)
            <h2 class="lead">Résumé par résultat (doublons écartés)</h2>
        <p>
            <label>KC:</label>
            @Html.DisplayFor(m => m.Summary.KcCount)
        </p>
        <p>
            <label>BC:</label>
            @Html.DisplayFor(m => m.Summary.BcCount)
        </p>
        <p>
            <label>FC:</label>
            @Html.DisplayFor(m => m.Summary.FcCount)
        </p>
        </p>
    }

    <h2 class="lead">Compte par année</h2>
    <div>
        @{
            var grid = new WebGrid(Model.SummaryByYear, defaultSort: "Year");
        }
        @grid.GetHtml(tableStyle: "webgrid-table",
                      headerStyle: "webgrid-header",
                      footerStyle: "webgrid-footer",
                      alternatingRowStyle: "webgrid-alternating-row",
                      selectedRowStyle: "webgrid-selected-row",
                      rowStyle: "webgrid-row-style",
                      mode: WebGridPagerModes.All,
                      columns:
                        grid.Columns(
                        grid.Column(columnName: "Year", header: "Year", format: @<text>@item.Year</text>),
                        grid.Column(columnName: "Count", header: "Count", format: @<text>@item.Count</text>),
                        grid.Column(columnName: "KC", header: "KC", format: @<text>@item.KC</text>),
                        grid.Column(columnName: "BC", header: "BC", format: @<text>@item.BC</text>),
                        grid.Column(columnName: "FC", header: "FC", format: @<text>@item.FC</text>)
                                                                                                                                                                                                                                ))
    </div>
</div>